<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wrap{
            width: 200px;
            height: 200px;
            border: 1px solid red;
            border-radius: 50%;
            position: relative;
        }   
        .box{
            width: 200px;
            height: 10px;
            background: pink;
            position: absolute;
            top: 100px;
            transform: rotate(30deg);
        }
        .box span{
            transform: rotate(30deg);
            position: absolute;
        }

        .hour{
            width: 10px;
            height: 80px;
            background: blue;
            position: absolute;
            left: 96px;
            top: 24px;
            /* transform: rotate(30deg); */
            /* transform-origin: left center; */
        }
        .minuts{
            width: 8px;
            height: 90px;
            background: yellow;
            left: 96px;
            top: 14px;
            position: absolute;
        }
        .second{
            width: 4px;
            height: 100px;
            background: black;
            position: absolute;
            left: 98px;
            top:0px;
            transform-origin: center bottom;
            transform: rotate(30deg);
        }

    </style>
</head>
<body>
    <div class="wrap">
        <!-- <div class="box">
          <span>1</span>  
        </div> -->
        <div class="hour"></div>
        <div class="minuts"></div>
        <div class="second"></div>
    </div>
    <script>
        
        // console.log(deg);
        // 获取元素  通过类名获取元素  getElementsByClassName 获取到的是伪数组  
      var secondEle =  document.getElementsByClassName("second")[0];
      secondEle.style.display = "none";
      console.log(secondEle);
      setInterval(function(){
        secondEle.style.display = "block";
        var time = new Date();
        var second = time.getSeconds();
        var deg = second/60 * 360;
        secondEle.style.transform = "rotate("+deg+"deg)"; 
      },1000)
      




    </script>
</body>
</html>